package messagesvc.api;

import cn.ucloud.microsf.commonlib.response.EmptyResponse;
import cn.ucloud.microsf.commonlib.response.PageListResponse;
import cn.ucloud.microsf.messagesvc.request.record.RecordListRequest;
import cn.ucloud.microsf.messagesvc.request.record.SendRequest;
import cn.ucloud.microsf.messagesvc.request.record.SubscribeCreateRequest;
import cn.ucloud.microsf.messagesvc.request.record.SubscribeListRequest;
import cn.ucloud.microsf.messagesvc.response.record.RecordListResponse;
import cn.ucloud.microsf.messagesvc.response.record.SubscribeListResponse;
import cn.ucloud.microsf.springlib.config.MicroSfFeignConfiguration;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Api(tags = "消息中心-订阅服务")
@FeignClient(name = "micro-message-svc", contextId = "micro-message-svc-sub", configuration = MicroSfFeignConfiguration.class)
public interface SubscribeController {

  @ApiOperation(value = "发送文本消息")
  @PostMapping("/msg/sub/create")
  EmptyResponse create(@RequestBody SubscribeCreateRequest request);

  @ApiOperation(value = "模板列表")
  @GetMapping("/msg/sub/list")
  PageListResponse<SubscribeListResponse> list(@SpringQueryMap SubscribeListRequest request);

}
